<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>二维码收款统计</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/wallet.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		    <h1 class="mui-title">二维码收款统计</h1>		    
		    <lable class="mui-pull-right  add" onclick=up_chain_info()>添加</lable>
		</header>
		<div class="mui-content fjysq_content">
			<div class="ewmtj_top clearfix">
				<div class="left">
					<p class="bt">今日交易额</p>
					<p class="num" id='day_money'></p>
				</div>
				<div class="right">
					<p class="bt">本月交易额</p>
					<p class="num" id='moon_money'></p>
				</div>
			</div>
			<div class="fjysq_lisbox ewmsk_lisbox">
				<div class="bt clearfix">
					<span class="left">名称</span>
					<span class="center">今日</span>
					<span class="right">本月</span>
				</div>
				<ul class="fjsq_list">
					<!--<li class="clearfix">
						<a href="#">
							<span class="left" id=''>联盟一号</span>
							<span class="center">
								<p>50元</p>
								<p>5笔</p>
							</span>
							<span class="right">
								<p>5000元</p>
								<p>50笔</p>
							</span>	
						</a>						
					</li>-->
				</ul>
			</div>
		</div>
	</body>
</html>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/layer/layer.min.js"></script>
<script type="text/javascript" src="../js/app.js"></script>
<script>
	$(function(){
		$.ajax({
			url: APP.api_url + 'agent/liansuod_index',
			data: {
				token: get_token(),
				uid: getUid()
			},
			success: function(data) {
				if(data.code=200){
					var day_money = data.data.day_money;
					var moon_money = data.data.moon_money;
					var chainstore_day_list = data.data.chainstore_day_list;
					var chainstore_moon_list = data.data.chainstore_moon_list
					var chain_list = data.data.chain_list;
					if(!day_money){
						day_money = 0;
					}
					//今日收入
					$('#day_money').text('￥'+day_money);	
					if(!moon_money){
						moon_money = 0;
					}
					//本月收入
					$('#moon_money').text('￥'+moon_money)
					//连锁店佣金
					var htm ='';
					for(var i=0;i<chain_list.length;i++){
							var chain_day = 0	;
							var chain_moon = 0	;
							if(chain_list[i].chain_day){
								chain_day  = chain_list[i].chain_day;
							}
							if(chain_list[i].chain_moon){
								chain_moon = chain_list[i].chain_moon;
							}
						
							html="<li class='clearfix'><a href='"+APP.web_root+"shopwallet/liansuod_page.html?chain_id="+chain_list[i].id+"'>"+
								 "<span class='left' id=''>"+chain_list[i].name+"</span>"+
								 "<span class='center'>"+
								 "<p>"+chain_day+"</p>"+
								 /*"<p>5笔</p>"+*/
								 "</span><span class='right'>"+
								 "<p>"+chain_moon+"</p>"+
								 /*"<p>50笔</p>"+*/
								 "</span></a></li>";
						$('.fjsq_list').append(html);
					}
					
					
				}else{
					jump("未开通店铺!","../member/index.html");
				}
			}
		});
		
	})
	function up_chain_info(chain_id){
		location.href = 'liansuod_page.html?chain_id='+chain_id;
	}
</script>
